import parole
from parole.colornames import colors
from parole.display import interpolateRGB
import pygame, random

import sim_creatures, main, random
from util import *

description = \
"""
He looked into the abyss and the abyss looked back.
"""

nagLines = [
        "The horror...",
        "No! No! No!", 
        "Dead. All dead.",
        "It came out of the dark...",
        "It sees. It sees in the dark.  It sees through you.",
        "Stop! Stop!  No further!",
        "*incomprehensible gibbering*",
        "The darkness moves down here.",
        "They screamed, for a moment.",
        "I can still smell it.",
        "This is the price of our wickedness.",
        "Pleasepleaseplease...",
        "I can still see it looking at me.",
        "No! Go back!",
        "*whimper*",
        "It cannot be seen.  It cannot be unseen.",
]

class NPCClass(sim_creatures.NPC):
    def __init__(self):
        sim_creatures.NPC.__init__(
            self,
            'crazy miner',    # name
            parole.map.AsciiTile('@', colors['Gray']), # symbol, color
            11,  # str
            8, # dex
            11,  # con
            11, # per
            10, # spd
            1,  # level
            description=description,
        )
        parole.info('New NPC: crazyminer.')

        main.schedule.listen('enter tile', self)

    def listen(self, event):
        super(NPCClass, self).listen(event)
        if random.random() < 0.9:
            return
        if not visible(self):
            return

        if event.id == 'enter tile':
            eObj, ePos, eMap = event.args
            if eMap is self.parentTile.map and eObj is main.player:
                self.say(random.choice(nagLines))

#========================================
thingClass = NPCClass






